<template>
    <view class="content">

        <view class="item">
            <!-- 顶部取餐码 -->
            <view class="item-middle">
					<view class="item-code">取餐码：<span>225</span></view>
                    <view class="item-status">已完成</view>
			</view>

            <view class="item-infos">
                <view class="item-info-up">
                    <view class="item-up-left">
                            <view class="item-up-left-top">
                                <view class="item-logo">
                                    <image src="/static/images/logo_text.png" alt=""></image>
                                </view>
                                <view class="item-adress">宝安区实验中学</view>
                            </view>
                            <view class="item-adress-text">
                                石岩街道罗祖社区租上新村一巷8号103
                            </view>
                    </view>
                    <view class="item-up-down">
                        <view class="item-mobile">
                            <image src="/static/images/mobile.png" alt=""></image>
                            <span>联系门店</span>
                        </view>
                        <view class="item-goadress">
                            <image src="/static/images/go.png" alt=""></image>
                            <span>前往门店</span>
                        </view>
                    </view>

                </view>
                <view class="item-down">
                    <view class="item-card">
                        <view class="item-pimg">
                            <image src="/static/images/product01.png" alt=""></image>
                        </view>
                        <view class="item-pinfo">
                            <view class="item-pname">龙井香青团</view>
                            <view class="item-pnote">大杯、珍珠、仙草、少冰、默认甜度</view>
                        </view>
                    </view>
                    <view class="item-pinfo2">
                        <view class="item-price">￥12.00</view>
                        <view class="item-num">x2</view>
                    </view>
                </view>
                <view class="item-coupon">
                    <u-collapse
                        @change="change"
                        @close="close"
                        @open="open"
                    >
                        <u-collapse-item
                            title="优惠合计"
                            name="Docs guide"
                            value="-￥4"
                            class="collapse-item"
                        >
                            <text class="u-collapse-content">新客，立减4元</text>
                        </u-collapse-item>
                        
                    </u-collapse>
                </view>
                <view class="item-total">
                    <text class="total-text">
                        共计2件商品，实付：<span>￥20.00</span>
                    </text>
  
                </view>
            </view>
            <view class="item-more">
                <u-cell-group customStyle="border:0 solid #ccc ;">
                    <u-cell customStyle="border:0 solid #ccc ;"  title="下单时间" value="2021-08-01 10:00-12:00"></u-cell>
                    <u-cell title="订单编号" value="101058540854354">
                        
                    </u-cell>
                </u-cell-group>
            </view>
            <view class="item-btn">
                <view class="btn" >
                        <u-button class="btn-primary" type="primary" :plain="true" :hairline="true" text="再来一单"></u-button>
                </view>
                
            </view>

		</view>
    </view>
</template>

<script>
export default {
    data() {
        return {
            //定义变量
            title: 'Hello',
            disabled: false  // 添加 disabled 数据属性
        }
    },
    onLoad() {
        console.log('页面加载完成');
    },
    methods: {

        goIndex(){
            console.log('跳转到首页');
            // 跳转到首页
            uni.navigateTo({
                url: '/pages/home/home'
            });

        }

    }
}


</script>

<style scoped lang="scss">

.item{
    width: 95%;
    margin: 0 auto;
    margin-top: 10px;
    border-radius: 8px;
    // box-shadow: 0 0 8px #ccc;
}
.item-middle{
    width: 100%;
    height: 150px;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    border-radius: 8px;
    box-shadow: 0 0 8px #ccc;
    background: linear-gradient(to bottom, #48be19, #fff);
    .item-code{
        font-size: 24px;
        color: #333;
        margin-left: 10px;
        span{
            color: rgb(13, 160, 0);
            font-weight: bold;
        }

    }
    .item-status{
        font-size: 15px;
        color: #293d2e;
        position: absolute;
        top: 5px;
        left: 5px;
    }
}
.item-infos{
    margin-top: 10px;
    border-radius: 8px;
    box-shadow: 0 0 8px #ccc;
}
.item-info-up{
    // height: 162px;
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    .item-up-left{
        margin: 5px;
        font-size: 16px;
        width: 60%;
        display: flex;
        align-items: flex-start;
        flex-direction: column;
        .item-up-left-top{
            display: flex;
            justify-content: space-between;
            align-items: center;
            // flex-direction: column;
            .item-logo{
                width: 25px;
                height: 15px;
                // border: 1px solid #ccc;
                // margin: 5px;
                image{
                    width: 25px;
                    height: 100%;
                    margin-bottom: 3px;
                }
            }
            .item-adress{
                font-size: 16px;
                color: #636363;
                margin-left: 10px;
            }

        }
        .item-adress-text{
            font-size: 12px;
        }
        
    }
    .item-up-down{
        max-width: 40%;
        display: flex;
        justify-content: center;
        align-items: center;
        margin-right: 5px;
        .item-mobile,.item-goadress{
            width: 50%;
            display: flex;
            justify-content: center;
            align-items: center;
            flex-direction: column;
            margin-left: 10px;
            image{
                width: 20px;
                height: 20px;
                padding: 5px;
                border-radius: 50%;
                background-color: #f0f0f0;
            }
            span{
                font-size: 12px;
                color: #333;
            }
        }
    }
}

.item-down{
    height: 70px;
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    .item-card{
        width: 70%;
        height: 100%;
        display: flex;
        justify-content: start;
        align-items: center;
        .item-pimg{
            width: 50px;
            height: 50px;
            border: 1px solid #ccc;
            background-color: #ccc;
            border-radius: 5px;
            margin-left: 10px;
            image{
                width: 100%;
                height: 100%;
            }
        }
        .item-pinfo{
            width: calc(100% - 60px);
            height: 100%;
            display: flex;
            justify-content: center;
            align-items: center;
            flex-direction: column;
            text-indent: 8px;
            .item-pname{
                width: 100%;
                font-size: 16px;
                color: #333;
            }
            .item-pnote{
                width: 100%;
                font-size: 12px;
                color: #999;
                margin-top: 5px;
                // 溢出省略号
                white-space: nowrap;
                text-overflow: ellipsis;
                overflow: hidden;
            }
        }
    }
    .item-pinfo2{
        width: 20%;
        height: 100%;
        display: flex;
        justify-content: center;
        align-items: center;
        flex-direction: column;
        .item-price{
            font-size: 14px;
            color: #333;
            margin-top: 10px;
        }
        .item-num{
            font-size: 14px;
            color: #333;
            margin-top: 5px;
        }
    }

}
.item-coupon{
    .collapse-item{
        // width: 20%;
    }
}
.item-total{
    width: 100%;
    height: 40px;
    display: flex;
    justify-content: end;
    align-items: center;
    .total-text{
        font-size: 14px;
        color: #333;
        margin-right: 8%;
        span{
            color: #ff5722;
            font-size: 16px;
            font-weight: bold;
        }
    }
}
.item-more{
    width: 100%;
    margin-top: 10px;
    border-radius: 8px;
    box-shadow: 0 0 8px #ccc;
    .item-creattime{
        color: #999;
    }
    .item-no{
        color: #999;
    }
}
.item-btn{
    width: 100%;
    margin-top: 10px;
}
</style>
